import {Trigger} from "solar/w3ts/handles/trigger";
import ForceUtil from "solar/util/ForceUtil";


export default class LimitUnitCountByUnitTypeOnGameStartState {
    static config: {
        [id: string]: number
    } = {}


    constructor() {
        let trigger = new Trigger()
        trigger.registerTimerEvent(2, false);
        trigger.addAction(this.action)

    }

    action(this: void) {
        ForceUtil.forUserForce(player => {

            for (let configKey in LimitUnitCountByUnitTypeOnGameStartState.config) {
                SetPlayerTechMaxAllowedSwap(FourCC(configKey), LimitUnitCountByUnitTypeOnGameStartState.config[configKey], player);
            }

        })


    }


}

